package com.morn.fanfou;

import android.net.Uri;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;

import com.morn.fanfou.fragment.UserViewFragment;

public class UserViewActivity extends FragmentActivity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		UserViewFragment userViewFragment = new UserViewFragment();
		Uri uri = getIntent().getData();
		if (uri != null) {
			String userId = uri.getAuthority();
			Bundle bundle = new Bundle();
			bundle.putString("userId", userId);
			userViewFragment.setArguments(bundle);
		} else {
			userViewFragment.setArguments(getIntent().getExtras());
		}
		getSupportFragmentManager().beginTransaction()
				.add(android.R.id.content, userViewFragment).commit();
	}

}
